<template>
  <div v-if="Object.keys(goods).length != 0" class="base-info">
    <div class="info-title">{{goods.title}}</div>
    <div class="info-price">
      <span class="n-price">{{goods.newprice}}</span>
      <span class="o-price">{{goods.oldprice}}</span>
      <span v-if="goods.discount" class="discount">{{goods.discount}}</span>
    </div>
    <div class="info-other">
      <span>{{goods.columns[0]}}</span>
      <span>{{goods.columns[1]}}</span>
      <span>{{goods.services[goods.services.length-1].name}}</span>
    </div>
    <div class="info-services">
      <span class="info-service-item" v-for="index in goods.services.length-1" :key ='index'></span>
    </div>
  </div>
</template>

<script>
  export default {
    name:'DetailBaseInfo',
    props:{
      goods:{
        type:Object,
        default(){
          return {}
        }
      }
    }
  }
</script>

<style scoped>
  .base-info{
    margin-top: 0.9375rem;
    padding: 0 0.5rem;
    color: #999;
    border-bottom: 0.3125rem solid #f2f5f8;
  }
  .info-title{
    color: #222;
  }
  .info-price{
    margin-top: 0.625rem;
  }
  .info-price .n-price{
    font-size: 1.5rem;
    color: hotpink;
  }
  .info-price .o-price{
    font-size: 0.8125rem;
    margin-left: 0.3125rem;
    text-decoration: line-through;
  }
  .info-price .discount{
    font-size: 0.75rem;
    padding: 0.125rem 0.3125rem;
    color: #fff;
    background-color: hotpink;
    border-radius: 0.5rem;
    margin-left: 0.3125rem;
    position: relative;
    top: -0.5rem;
  }
  .info-other{
    margin-top: 0.9375rem;
    line-height: 1.875rem;
    display: flex;
    font-size: 0.8125rem;
    border-bottom: 0.0625rem solid rgba(100,100,100,1);
    justify-content: space-between;
  }
  .info-services{
    display: flex;
    justify-content: space-between;
    line-height: 3.75rem;
  }
  .info-service-item img{
    width: 0.875rem;
    height: 0.875rem;
    position: relative;
    top: 0.125rem;
  }
  .info-service-item span{
    font-size: 0.8125rem;
    color:#333;
  }
</style>
